package com.cxfpro.controller;

import com.cxfpro.client.HystrixOrderClient;
import com.cxfpro.client.UserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: xuanfei.Chen
 * @Date: 2018/12/7 15:20
 * @Description:
 */
@RestController
public class UserController {

  @Autowired
  private UserClient userClient;

  @Autowired
  private HystrixOrderClient hystrixOrderClient;

  @RequestMapping(method = RequestMethod.GET, value = "/sayHello")
  public String sayHello(){
    return userClient.sayHello();
  }

  @RequestMapping(method = RequestMethod.GET, value = "/sayOrder")
  public String sayOrder() { return hystrixOrderClient.sayOrder(); }

}
